package com.yuyou.train.user.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.yuyou.train.service.api.lesson.dto.UserLessonTreeDTO;
import com.yuyou.train.service.api.user.entity.UserLessonProgress;
@Mapper
public interface UserLessonProgressMapper {
    int deleteByPrimaryKey(String id);

    int insert(UserLessonProgress record);

    UserLessonProgress selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(UserLessonProgress record);

    UserLessonProgress getUserCurrLesson(
    		@Param(value="userId") String userId,
    		@Param(value="classId") String classId);
    
    List<UserLessonProgress> findUserLessonProgress(
			UserLessonProgress userLessonProgress);
    
    List<UserLessonTreeDTO> getUserLessonTree(
    		@Param(value="classId") String classId,@Param(value="userId") String userId
    		,@Param(value="subjectId") String subjectId );
    
    List<UserLessonTreeDTO> getUserchapterTree(
    		@Param(value="lessonId") String lessonId,@Param(value="userId") String userId
    		,@Param(value="subjectId") String subjectId );
    
    
    
    String getUserNextLesson( 
			@Param(value="classId") String classId,@Param(value="userId") String userId
    		,@Param(value="subjectId") String subjectId );
    
    
    UserLessonProgress getUserFirstLesson( 
			@Param(value="classId") String classId,
			@Param(value="userId") String userId);
    
    UserLessonProgress selectByUserIdAndLessonId(
    		@Param(value="userId") String userId,
    		@Param(value="lessonId") String lessonId);
    
    
    List<UserLessonProgress> findByUserAttr(
    		@Param(value="userId") String userId,
    		@Param(value="classId") String classId,
    		@Param(value="isAttr") String isAttr);
    
    UserLessonProgress selectUserEndLesson(
    		@Param(value="userId") String userId,
    		@Param(value="classId") String classId,
    		@Param(value="lessonId") String endLessonId);
    
}